class Array
  def *(n)
    Array.new(n, self)
  end
end

def allpossibles(algs, combinable=false)
  letters = combinable || ("a".."z").to_a;
  words = []; 
  code = "";
  concat = "words <<"
  algs.times do |col|
    code << "letters.each do |a#{col}|\n"
    concat << " a#{col} + "
  end
  code = code + concat + "\"\""
  algs.times{code << "\nend"}
  eval(code)
  words
end
pos = allpossibles(2)
puts pos[rand(pos.size)]
